home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson5 / Lesson5.dcr / 00206_Item field selected.ls < prev    next >
Encoding:
Text File  |  2001-02-01  |  1.5 KB  |  53 lines

  1. property pDeviantTarget, spriteNum
  2. global pgProvinceCode, itemListRow, immutableItems, mutableItems
  3.  
  4. on getPropertyDescriptionList
  5.   description = [:]
  6.   addProp(description, #pDeviantTarget, [#default: EMPTY, #format: #string, #comment: "Not In List Target:"])
  7.   return description
  8. end
  9.  
  10. on doListSelect
  11.   unfound = "TRUE"
  12.   repeat with i = 1 to immutableItems.count
  13.     if immutableItems[i].ItemName = sprite(spriteNum).member.text then
  14.       doFillInvoiceItem(immutableItems[i])
  15.       reCalcInvoice()
  16.       unfound = "FALSE"
  17.       exit repeat
  18.     end if
  19.   end repeat
  20.   if unfound = "TRUE" then
  21.     repeat with i = 1 to mutableItems.count
  22.       if mutableItems[i].ItemName = sprite(spriteNum).member.text then
  23.         doFillInvoiceItem(mutableItems[i])
  24.         reCalcInvoice()
  25.         unfound = "FALSE"
  26.         exit repeat
  27.       end if
  28.     end repeat
  29.   end if
  30.   if (unfound <> "FALSE") and (sprite(spriteNum).member.text <> EMPTY) then
  31.     go(pDeviantTarget)
  32.   end if
  33. end
  34.  
  35. on doFillInvoiceItem corpse
  36.   member("field:Desc" & string(itemListRow)).text = corpse.Desc2
  37.   member("field:Rate" & string(itemListRow)).text = string(corpse.Money2)
  38.   tQty = value(member("field:Qty" & string(itemListRow)).text)
  39.   if tQty < 1 then
  40.     tQty = 1
  41.   end if
  42.   t = value(corpse.Money2) * tQty
  43.   member("field:Amount" & string(itemListRow)).text = string(t)
  44.   ttx = corpse.Tax2
  45.   case pgProvinceCode of
  46.     "AB", "NU", "NT", "YT", "--":
  47.       if ttx = "S" then
  48.         ttx = "G"
  49.       end if
  50.   end case
  51.   member("field:Tax" & string(itemListRow)).text = ttx
  52. end
  53.